/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jus.aor.mobilagent.kernel;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author thomas
 */
public class AgentServer extends Thread {

    private ServerSocket serverSocket;
    private int port;

    public void addService(ServiceInterface service) {
        
    }

    @Override
    public void run() {
        try {
            serverSocket = new ServerSocket(port);
            while(true){
                Socket s = serverSocket.accept();
                
//                AgentInputStream ais = new AgentInputStream(s.getInputStream(), loader);
                
            }
        } catch (IOException ex) {
            Logger.getLogger(AgentServer.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public void startAgent(AgentInterface agent) {
    }
}
